//
//  DiaryDTO.swift
//  
//
//  Created by Jiang Chencheng on 2024/9/11.
//

import Fluent
import Vapor

struct DiaryDTO: Content  {
    var id: UUID?
    var content: String?
    
    func toModel() -> Diary {
        let model = Diary()
        
        model.id = id
        
        if let content = self.content {
            model.content = content
        }
        
        return model
    }
}
